<?php
namespace Multilang;

// use Pinenut\Form;
use Pinenut\Form;
use Pinenut\Model2\Finder;

/*
 * Multilang Panel Items Action
 * Created & Modified by ITokarev
 * 
 * Базовый класс, реализующий список в панели
 * для перевода текстов
*/

class ItemsAction extends \Action
{
	protected static $isPublic = true;
	
	//тут мы говорим какую вызывать вьюху.
	protected static $defaultViews = ['#multilang.items'];
	
	function run()
	{
		$langId = $this->request->_langId;
		$query = $this->request->filterText;
		$strategy = $this->request->filterType;
		$collectedEntities = $this->request->collectedEntities;

		$this->response->items = TranslateEntities::getItemsForTranslate($collectedEntities, $query, $strategy, $langId);
		$this->response->langId = $this->request->_langId;
	}
}